package com.mac.hosp_pre.order.config;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.profile.DefaultProfile;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@ConfigurationProperties(prefix = "hosp.sms")
@Configuration
@Data
public class AliyunConfig {

     private String regionId;

     private String accessKey;

     private String secretKey;

     private String templateCode;

     private String signName;

     @Bean
     public IAcsClient acsClient(){
          DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKey, secretKey);
          return new DefaultAcsClient(profile);
     }
}
